package com.example.liapiinterface.controller;

import com.example.liapiinterface.model.User;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/name")
public class NameController {
    @GetMapping("/")
    public String getName(String name){
        return "你的名字是"+name;
    }
    @PostMapping("/")
    public String getNameByPost(@RequestParam String name){
        return "POST your name is "+name;
    }
    @PostMapping("/username")
    public String getUsernameBypPost(@RequestBody User user ){
        return "Post Username is"+ user.getUsername();
    }
}
